/*
 * @Author: XieQiu 雪球
 * @Date: 2021-05-17 15:33:04
 * @LastEditTime: 2021-05-18 09:13:08
 * @LastEditors: XieQiu 雪球
 * @Description: 巡检路线管理接口
 */

import request from '@/utils/request'
// var organizationNo = sessionStorage.getItem("organizationNo");
// var organizationNo = JSON.parse(organizationNo);

export default {
  /**
   * @description: 获取巡检路线名称列表 *代表必填
   * @param {String/Number} page *
   * @param {String/Number} size *
   * @param {Object} entity {componyId: 1} *
   * @param {String} order 排序方式 ASC DESC 默认ASC
   * @param {String} sort 自定义排序方式 'createTime'
   * @return {Array}
   */
  getInspectionRouteList(params) {
    return request.post("/v3/patrol/inspectionRoute/queryPageList", params);
  },
  /**
   * @description: 获取所有巡查路线 *代表必填
   * @param {String} organizationNo *
   * @return {Array}
   */
  inspectionRouteCondition() {
    return request.post("/v3/patrol/inspectionRoute/queryByCondition", {
      organizationNo: sessionStorage.organizationNo
    });
  },
  /**
   * @description: 获取所有巡查点列表 *代表必填
   * @param {String} organizationNo *
   * @return {Array}
   */
  getInspectionPointCondition() {
    return request.post("/v3/patrol/inspectionPoint/queryByCondition", {
      organizationNo: sessionStorage.organizationNo

    });
  },
  /**
   * @description: 根据ID获取详细的巡检路线信息 *代表必填
   * @param {String} inspectionRouteId *
   * @return {Array}
   */
  getDetailInspectionRouteById(id) {
    return request.get(`/v3/patrol/inspectionRoute/query?inspectionRouteId=${id}`);
  },
  /**
   * @description: 新增巡检路线信息
   * @param {Object} formData *
   * @return {Object}
   */
  addInspectionRouteInfo(formData) {
    formData.organizationNo = sessionStorage.organizationNo
    return request.post("/v3/patrol/inspectionRoute/add", formData);
  },
  /**
   * @description: 编辑巡检路线信息
   * @param {Object} formData *
   * @return {Object}
   */
  editInspectionRouteInfo(formData) {
    formData.organizationNo = sessionStorage.organizationNo
    return request.post("/v3/patrol/inspectionRoute/edit", formData);
  },
  /**
   * @description: 批量删除数据
   * @param {Array} list *
   * @return {Object}
   */
  delInspectionRouteInfo(list) {
    return request.post("/v3/patrol/inspectionRoute/delList", {
      inspectionRouteIdList: list
    });
  }
};
